package String;

public class string_replace {
    public static void main(String[] args) {
        //敏感词替换
        String talk="你玩的真好，TMD,CNM";

        //定义一个敏感词库
        String[]arr={"TMD","CNM","SB","MLGB"};

        //把TMD替换掉
        for(int i=0;i<arr.length;i++)
        {
            talk=talk.replace(arr[i],"***");
        }

        System.out.println(talk);
    }
}
